The present invention relates to a control apparatus and method for controlling an open/close member such as a power window apparatus which opens and closes a window glass of a vehicle and sunroof apparatus which opens and closes a roof glass of a vehicle.
A motor used as a drive source of a power window apparatus for a vehicle is generally provided with a motor body and a reduction gear mechanism that reduces the rotation speed of the motor body and outputs the reduced rotation, with the motor body and reduction gear mechanism assembled as one body. This motor outputs a pulse signal synchronized with the rotation of a rotation shaft of the motor body to a controller. The controller detects the position of a window glass by counting edges of the pulse signal and detects the rotation speed of the motor body based on the period of the pulse signal. Since the window glass is opened and closed by driving the motor, the controller is provided with a function for preventing the window glass from trapping foreign matter. When the rotation speed of the motor body decreases extensively within the range of a count value for determining the presence or absence of trapped matter during the closing operation for the window glass, this trapping prevention function determines that the rotation speed of the motor body has been reduced because foreign matter is trapped in the window glass. Then, the trapping prevention function drives the motor body backward to open the window glass by a predetermined amount so as to release the trapped foreign matter.
In order not to misidentify the current position of the actual window glass when the supplied drive power is shut off, the controller writes position information of the window glass into an electrically rewritable (erasable) ROM such as EEPROM built in the controller at a predetermined timing.
For example, the controller disclosed in Japanese Laid-Open Patent Publication No. 8-331877 writes position information of the window glass into a ROM after lapse of a predetermined time after a command for a motor is changed from an operation command to a stop command or after stoppage of the motor is confirmed. Furthermore, when the supply voltage falls below a predetermined value for more than a predetermined time, the controller writes the position information of the window glass into the ROM after lapse of a predetermined time or after stoppage of the motor is confirmed. Furthermore, when it is determined that torque equal to or greater than a predetermined value is output for a predetermined time or more, the controller writes the position information of the window glass into the ROM. Furthermore, when a command for the motor is a stop command, the controller writes the position information of the window glass into the ROM every time after lapse of a certain time.
However, in the case of the apparatus described in Japanese Laid-Open Patent Publication No. 8-331877, when the power supply to the controller is stopped before the position information of the window glass is written into the ROM during operation of the window glass (when the motor is in operation) and the power supply is restarted, the current position of the actual window glass has moved from the position of the window glass corresponding to the position information written in the ROM. That is, the current position of the window glass is different from the position of the window glass corresponding to the position information written in the ROM. For this reason, the controller misidentifies the current position of the window glass, which causes trouble with control of the motor. Therefore, the apparatus in Japanese Laid-Open Patent Publication No. 8-331877 is not considered as one that contemplates the case where the power supply to the controller is stopped before the position information of the window glass is written into the ROM during operation of the window glass.
Thus, in the above described case, it is necessary to perform relearning of the origin position to match the actual window glass position with the position of the window glass corresponding to the position information written into the ROM. Thus, it is possible to perform relearning of the origin position for all cases where the power supply to the controller is stopped and the power supply is restarted.
However, the relearning of the origin position involves a complicated operation which requires a manual operation by an operator such as operating the window glass up to mechanical limit positions such as a fully open position or fully closed position and operating predetermined switches. Furthermore, when the window glass is stopped (when the motor is stopped), even if the power supply to the controller is stopped and then restarted, the current position of the actual window glass matches the position of the window glass corresponding to the position information written in the ROM. Thus, the controller identifies the current position of the window glass correctly and there is no trouble with the control of the motor, and therefore there is no need to perform relearning of the origin position. On the other hand, when relearning of the origin position is performed for all cases where the power supply to the controller is stopped and then restarted, the relearning of the origin position needs to be performed even when there is no need to perform relearning of the origin position as described above.